Skip to content

chore: extract tar files with the PEP 706 data filter - #975

Merged
bnusunny merged 1 commit into
aws:developfrom
bnusunny:fix/tar-data-filter
Nov 18, 2026
Merged

bnusunny merged 1 commit into
aws:developfrom
bnusunny:fix/tar-data-filter

Conversation

@bnusunny

@bnusunny bnusunny commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Issue #, if available: N/A

Description of changes

extract_tarfile now passes filter="data" (PEP 706) to tar.extractall() when tarfile.data_filter is available (Python 3.10.12+, 3.11.4+, 3.12+). This matches the default Python uses from 3.14, so tarballs extract the same way on every supported Python. Older patch releases without data_filter keep the current call.

Description of how you validated changes

  • New functional tests in tests/functional/test_utils.py for the filter's behaviour (links outside the unpack directory are rejected, the executable bit is kept). Passing on Python 3.10 to 3.14.
  • tests/unit and related functional tests pass. tests/integration/workflows/nodejs_npm (real npm pack) passes.
  • black --check, ruff check and mypy are clean.

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bnusunny
bnusunny requested a review from a team as a code owner November 18, 2026 21:54
@bnusunny bnusunny changed the title fix: extract tar files with the PEP 706 data filter chore: extract tar files with the PEP 706 data filter Nov 18, 2026
Pass filter="data" to tar.extractall() when tarfile.data_filter is
available (Python 3.10.12+, 3.11.4+, 3.12+). This matches the default
Python uses from 3.14. Older patch releases keep the current call.
@bnusunny
bnusunny merged commit 74530f7 into aws:develop Nov 18, 2026
124 checks passed
@bnusunny bnusunny mentioned this pull request Nov 19, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants